package crazy.collection;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class ArrayListRemove
{
	public static void main(String[] args)
	{
		List<String> list = new ArrayList<String>();
		list.add("111");
		list.add("222");
		list.add("333");
		
		for (Iterator it = list.iterator(); it.hasNext();)
		{
			String ele = (String) it.next();
			System.out.println(ele);
			if (ele.equals("222"))
			{
				it.remove();
				//list.remove(ele);//List集合对应的Itr的hasNext()方法
			}
		}
		System.out.println(list);
	}
}
